* Main Analysis
* This script creates individual tex files that are then combined to create final tables in paper

* folder to save output
local folder rd_regs
capture mkdir "${base_dir}/results/`folder'"

/*
* Table 1 and Table A.3
* main results
local rte_opts all_exits all_coast   
local table_tags main main_supp 
*levelsof vesseltype_regstr, local(vestypes)
local vestypes `"Container "Other Cargo" Tanker"'
local eca_ys 2009
local report_extra_mean 1
local report_spillover 1

do "${base_dir}/analysis_code/RDregressions.do" /// 
		"`folder'" "`rte_opts'" "`table_tags'" `"`vestypes'"' "`eca_ys'" ///
		"`report_extra_mean'" "`report_spillover'"
*/

* Table A.4
* unexposed routes
local rte_opts other_exits 
local eca_ys  2009 // 2011 
local table_tags main_unex  
local vestypes "Container" 
local report_extra_mean 0
local report_spillover 1

do "${base_dir}/analysis_code/RDregressions.do" /// 
		"`folder'" "`rte_opts'" "`table_tags'" `"`vestypes'"' "`eca_ys'" /// 
		"`report_extra_mean'" "`report_spillover'"

	
* Table A.8 and Table A.9 and Table A.15
* route heterogeneity
local rte_opts socal_exits_south0 socal_exits_south1 socal_coast nocal_coast nocal_exits 
local eca_ys 2009 2011 
local table_tags main xvar
local vestypes "Container" // `" "Other Cargo" Container Tanker"'
local report_extra_mean 0
local report_spillover 1

do "${base_dir}/analysis_code/RDregressions.do" /// 
		"`folder'" "`rte_opts'" "`table_tags'" `"`vestypes'"' "`eca_ys'" ///
		"`report_extra_mean'" "`report_spillover'"


* Table A.13
* Fuel and Marginal Damage Assumptions/Robustness
local rte_opts all_coast all_exits  
local eca_ys 2009
local table_tags robust 
local vestypes "Container"
local report_extra_mean 0
local report_spillover 1

do "${base_dir}/analysis_code/RDregressions.do" /// 
		"`folder'" "`rte_opts'" "`table_tags'" `"`vestypes'"' "`eca_ys'" ///
		"`report_extra_mean'" "`report_spillover'"
	

* Table 3 
* tables with average effects used to calculate total welfare impacts
local rte_opts nocal_exits nocal_coast socal_coast socal_exits  
local eca_ys 2009
local table_tags welfare_levels // robust_blend robust_central robust_ap2  
local vestypes `" "Other Cargo" Container Tanker"'
local report_extra_mean 0
local report_spillover 1

do "${base_dir}/analysis_code/RDregressions.do" /// 
		"`folder'" "`rte_opts'" "`table_tags'" `"`vestypes'"' "`eca_ys'" /// 
		"`report_extra_mean'" "`report_spillover'"
